package models

type Links struct {
	Id    int
	Title string
	Href  string
}

var (
	link Links
)

func NewLink() *Links {
	return &Links{}
}

func (this *Links) Insert() {
	db = GetDb()
	stmt, err := db.Prepare("insert into links(Title, Href) values(?, ?)")
	if err != nil {
		panic(err.Error())
	}
	_, err1 := stmt.Exec(this.Title, this.Href)
	if err1 != nil {
		panic(err1.Error())
	}
}
